/*
 * Copyright (c) 2022, tyustli
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-02-08     tyustli      first implementation
 */

#include <stdio.h>
#include <math.h>

static char prime_num(int value)
{

    int i = 2;
    for (i = 2; i < value; i++)
    {
        if (value % i == 0)
            return 0;
    }

    return 1;
}

int main(int argc, char **argv)
{

    printf("1 is %d\r\n", prime_num(1));
    printf("2 is %d\r\n", prime_num(2));
    printf("3 is %d\r\n", prime_num(3));
    printf("4 is %d\r\n", prime_num(4));
    printf("5 is %d\r\n", prime_num(5));
    printf("6 is %d\r\n", prime_num(6));
    printf("7 is %d\r\n", prime_num(7));
    printf("8 is %d\r\n", prime_num(8));
    printf("29 is %d\r\n", prime_num(29));

    return 0;
}

/******************** end of file **********************/
